<template>
	<view class="safe">
		<view class="set-list">
			<view class="list_li" v-for="(item,index) in mylist" @tap="gopath(item.path)">
				<view class="li-left">
					<text class="left-text">{{t(item.text)}}</text>
				</view>
				<image src="@/static/imgs/my/arrow_right.png" mode="" class="li-right"></image>
			</view>
		
		</view>
		<view class="logout" @tap="gologout()">
			<text>{{t('user.logout')}}</text>
		</view>
	</view>
</template>

<script setup>
	import {
		useI18n
	} from "vue-i18n";
	
	const {
		t
	} = useI18n()
	uni.setNavigationBarTitle({
		title: t('user.setting')
	});
	const mylist = [{
			text: 'user.setuserinfo',
			path: 'setuserinfo'
		},
		{
			text: 'user.version',
			path: 'renew'
		},
	
	
	]
	const unopen = () => {
		uni.showToast({
			icon: 'none',
			title:  t('user.Notopenyet'),
		});
	}
	const gologout = () =>{
		uni.setStorageSync('token','')
		uni.reLaunch ({
			url:'/pages/login/login'
		})
	}
	const gopath = (path) => {
		if (!path) return unopen()
		if (path) {
			uni.navigateTo({
				url: path,
			});
		}
	}
</script>

<style scoped lang="scss">
	.safe{
		width: 100%;
		min-height: 100vh;
		background-color: #F2F4F7;
		padding-top: 16rpx;
	}
	.logout{
		background-color: #fff;
		margin-top: 16rpx;
		width: 100%;
		height: 104rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 16px;
		font-weight: 500;
		letter-spacing: 0px;
		line-height: 22.4px;
		color: rgba(212, 48, 48, 1);
	}
	.set-list {
	
	  
		width: 100%;
		padding: 36rpx;
		padding-bottom: 0;
		padding-top: 0;
		opacity: 1;
	
		background: #fff;
	
		.list_li:last-child {
			border-bottom: none;
		}
	
		.list_li {
			width: 100%;
			display: flex;
			align-items: center;
			justify-content: space-between;
			box-sizing: content-box;
			padding-top: 36rpx;
			padding-bottom: 36rpx;
			border-bottom: 1px solid rgba(242, 244, 247, 1);
	
			.li-right {
				height: 26rpx;
				width: 14rpx;
	
			}
	
			.li-left {
				display: flex;
				align-items: center;
	
				.left-icon {
					width: 40rpx;
					height: 40rpx;
					margin-right: 12rpx;
				}
	
				.left-text {
					font-size: 16px;
					font-weight: 500;
					letter-spacing: 0px;
					line-height: 22.4px;
					color: rgba(15, 24, 40, 1);
				}
			}
		}
	}
</style>